package com.sqx.modules.errand.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.errand.entity.*;
import com.sqx.modules.errand.vo.BasicsVo;
import com.sqx.modules.errand.vo.CalculatePrice;
import com.sqx.modules.errand.vo.IndentVo;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

public interface IndentService extends IService<Indent> {

    Indent findIndentByIndentNumber(String indentNumber);

    Indent findIndentByPayOrdersNo(String ordersNo);

    Result addIndentBuy(Indent indent);


    IPage<Indent> findNewIndent(Long userId, Integer page, Integer limit, Double ol, Double od, Indent indent);


    void setCommission(Long indentId, Integer classify);

    Result riderDelivery(Long userId, String indentId);



    Result userCancleIndent(Long userId, String indentNumber);

    Result riderCancelIndent(Long userId, String indentId);

    IPage<Indent> findUserIndent(Integer page, Integer limit, Indent indent);

    Result distance(Double ol, Double od, Double dl, Double dd, Integer type);

    List<Indent> findNoPay();

    int cancelIndent(String indentNumber);


    Result basicsMoney(Long userId,BasicsVo basicsVo);

    CalculatePrice getCalculatePrice(String goProvince,String city,double goLng, double goLat, double toLng, double toLat,Integer type);


    Result findComplaint(Long userId, Long complaintId, String indentNumber);



    IndentVo userIndentMessage(String indentNumber);


    Result findVicinityRider(Double lng, Double lat);

    /**
     * @param page
     * @param limit
     * @param userId       当前登录人
     * @param indentNumber 订单号
     * @return
     */
    IPage<Indent> getIndentList(Integer page, Integer limit, Long userId,Integer indentType, String indentNumber,String startTime,String endTime);

    BigDecimal getOneProfit(Long userId, int level);

    Result distributionOrder(Long indentId, Long userId);

    IPage<HashMap<String,Object>> getProfitList(Integer page, Integer limit, String time, Integer flag);

    Result indentReceiving(Long userId, String indentNumber);

    IPage<Indent> getRiderIndentList(Long userId, Integer page, Integer limit, String indentState);

    Result riderStartDrive(Long userId, Long indentId);

    Result indentPayCallback(Long indentId,Integer classify,BigDecimal payMoney);

    List<IndentVo> indentExcelOut(String indentType, String indentNumber, String indentState, String phone, String date, String dateType, String startTime, String endTime, String parentName, String parentParentName, HttpServletResponse response);

    HashMap<String,Integer> getOrderSubscript(Long userId);

    IndentVo riderGetIndentInfo(Long userId, String indentNumber);

    Result userEvaluate(Long userId, Evaluate evaluate);

    int getUserIndentCount(Long userId);

    BigDecimal getUserIndentMoney(Long userId);

    Result riderWaitDrive(Long userId, Long indentId);
}
